<?php

use yii\db\Migration;

/**
 * Handles the creation of table `application_result`.
 */
class m171102_092007_create_application_result_table extends Migration
{
    /**
     * @inheritdoc
     * 审批结果表
     */
    public function up()
    {
        $this->createTable('application_result', [
            'id' => $this->primaryKey(),
            'application_id' => $this->bigInteger()->notNull(),
            'result' => $this->smallInteger()->defaultValue('1')->comment('审批结果'),//1未审核，2通过，3未通过，
            'note' => $this->text()->comment('审批意见'),
            'reviewed_at' => $this->timestamp()->comment('审批时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('application_result');
    }
}
